package cate.game.farm.local.udgpalace;

import cate.game.db.facade.KvLoader;
import cate.game.db.mongo.kv.KvMongo;
import cate.game.framework.ModuleMan;
import cate.game.res.holy_pet.core.HolyPetSPO;

public class UdgPalaceManager extends ModuleMan {
    public UdgPalaceSPO data;

    @Override
    public void initDependent() throws Exception {
        data = new KvLoader<>(game, UdgPalaceSPO.class, KvMongo.KEY_UDG_PALACE).getBySrvId();
        data.initialize(game);
    }

    @Override
    public void shutdown(){
        game.db.kv.save(data);
    }

    @Override
    public void onDaySpan(){
        boolean reset = data.checkCycle(game);
        if (reset) {
            log.info("重置地宫探险赛季辣，season={}", data.weekNo);
        }
    }
}
